package com.cn.springcloudwechat.controller;

import com.cn.springcloudwechat.common.ajax.AjaxRes;
import com.cn.springcloudwechat.common.utils.base.Const;
import com.cn.springcloudwechat.controller.vaccine.log.LogInfo;
import com.cn.springcloudwechat.controller.vaccine.log.OperateType;
import com.cn.springcloudwechat.model.YmUserInfrom;
import com.cn.springcloudwechat.service.YmUserInfromService;
import com.cn.springcloudwechat.service.find.communication.CommunicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ymUserInfrom/")
public class YmAnswerControllerq {

    @Autowired
    private YmUserInfromService ymUserInfromService;

    @Autowired
    private CommunicationService communicationService;

    /**
     * 新增用户系统消息
     * @param ajaxRes
     * @param ymUserInfrom
     * @return
     */
    @RequestMapping("insertUserInformation")
    @LogInfo(content = "新增用户系统消息", operateType = OperateType.INSERT)
    public AjaxRes insertUserInformation(AjaxRes ajaxRes, YmUserInfrom ymUserInfrom){
        try{
            Integer result = ymUserInfromService.insertUserInformation(ymUserInfrom);
            ajaxRes.setSucceed(result, Const.SAVE_SUCCEED);
        }catch (Exception e){
            ajaxRes.setFailMsg(e.getMessage());
        }
        return ajaxRes;
    }
}
